#!/bin/bash;
TNDB_Linux_32bit <<EOF
use 深沪A股UTF8.TNDB;
select * from (select * from Table1 where tonum(现价) between 2 and 5 and 所属行业="金融行业" or 名称="贵州茅台");
select 代码,名称,tonum(现价) from (select * from Table1 where tonum(现价) between 2 and 5 and 所属行业="金融行业" or 名称="贵州茅台") where tonum(现价) between 1 and 3;
select * from (select 代码,名称,tonum(现价) from (select * from Table1 where tonum(现价) between 2 and 5 and 所属行业="金融行业" or 名称="贵州茅台") where tonum(现价) between 1 and 3) where left(名称,2)="农业";
select * from (select * from Table1) where tonum(现价) between 1 and 3 and left(名称,2)="中国";
select 代码,名称,tonum(现价) from (select * from Table1 where tonum(现价) between 2 and 5 and 所属行业="金融行业" or 名称="贵州茅台") where tonum(现价) between 1 and 3 and left(名称,2)="中国";
select * from Table1 where left(名称,2)="中国" and 代码<600000;
select * from Table1 where right(名称,2)="银行";
select * from Table1 where mid(名称,1,2)="国重" or mid(名称,2,2)="铝业";
select * from Table1 where substr(名称,1,3)="国建筑";
select * from Table1 where tonum(现价) between 10 and 300 and left(名称,2)="中国";
select * from Table1 where tostr(代码)=reverse(代码) and (代码 between 8 and 18 or 代码 between 28 and 38);
select * from Table1 where tostr(代码)=reverse(代码) and ((代码 between 8 and 18 or 代码 between 28 and 38) or 代码 between 48 and 58);
select * from Table1 where 代码=888;
select * from Table1 where tonum(现价) between 0.01 and 2;
select * from Table1 where tonum(现价) between 2 and 5 and 所属行业="金融行业";
select * from Table1 where tonum(现价) between 2 and 5 and 所属行业="金融行业" or 名称="贵州茅台";
select 代码,名称,tonum(现价) from (select * from Table1 where tonum(现价) between 2 and 5 and 所属行业="金融行业" or 名称="贵州茅台");
select * from Table1 where sum(代码,代码,代码,代码)=88;
select * from Table1 where sum(代码,代码,代码,代码)=88 and sum(代码)=22;
select * from Table1 where sum(代码,代码,sum(代码,代码),代码)<1000 and sum(代码)>100;
select * from Table1 where 代码<20 and sum(sum(代码,sum(代码,代码)),代码,sum(代码,代码),代码)=7;
select * from Table1 where 代码<20 and sum(sum(代码,sum(代码,代码)),代码,sum(代码,代码),代码)=7 and sum(代码)=1;
select * from Table1 where left(代码,3)="1";
select * from Table1 where reverse(代码)=left(代码,6) and 代码 between 30 and 40;
select * from Table1 where left(代码,3)=tostr(代码) and 代码 between 420 and 440;
select * from Table1 where tonum(left(代码,3))=代码 and 代码 between 288 and 388;
select tonum(现价),代码,买入价 from Table1 where sum(代码,tonum(left(代码,3)))=sum(代码,tonum(right(代码,3))) and (tonum(现价) >= 7.50 and tonum(现价)<=8.00);
select 代码,买入价 from Table1 where sum(代码,tonum(left(代码,3)))=sum(代码,tonum(right(代码,3))) and tonum(现价) between 7.50 and 8.00;
select * from Table1 where tostr(代码)=reverse(代码) and (代码 between 1 and 50 or 代码 between 800 and 888);
quit;
EOF